﻿/*
*	AUTHOR：K老叶
*	NAME：加密器
*	LICENSE：Apache License 2.0
*/

#include<stdio.h>
#include<stdlib.h>
#include<windows.h>
#include"FIO.h"
#pragma warning (disable:4996)
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;

uchar * readFile(uchar *string,FILE *file)
{
	long file_size;
	fseek(file, 0, 2);
	file_size=ftell(file);
	//fseek(file, 0, 0);
	string = (uchar*)calloc(file_size+1,sizeof(uchar));
	fread(string, sizeof(uchar*), file_size, file);
	printf("%ld--%s\n",file_size,string);
	fclose(file);
	return string;
}

void writeFile(uchar *string,FILE *file)
{
	fputs(string,file);
	fclose(file);
}